package com.baofu.paycore.web.controller.monitor;

import com.system.dispatch.Dispatcher;
import com.system.dispatch.DispatcherStart;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.Collection;

/**
 * dispatch 线程监控
 *
 * <p>
 * </p>
 * User: LZQ Date: 2016/11/15  Version: 1.0
 */
@Controller
public class DispatchMonitor {

    @Resource(name = "dispatcherStarter")
    private DispatcherStart dispatcherStart;

    @RequestMapping("monitor")
    @ResponseBody
    public String monitor(){
        //Collection<Dispatcher> dispatchers = dispatcherStart.getDispatcherMap().values();
        String info = "";
        /*for (Dispatcher dispatcher : dispatchers) {
            info += dispatcher.getName() + "---" + dispatcher.poolInfo();
        }*/
        return info;
    }

}
